#ifndef backicon_h
#define backicon_h

#include "juce_amalgamated.h"
#include "SwitchablePanel.h"

class BackButton: public ArrowButton {
private:
	SwitchablePanel* panel;
	int from, to;
public:
	BackButton(SwitchablePanel* panel, int from, int to) :
		ArrowButton(T(""), 0.5, Colours::black) {
		this->panel = panel;
		this->from = from;
		this->to = to;
	}

	BackButton(SwitchablePanel* panel) :
		ArrowButton(T(""), 0.5, Colours::black), from(0), to(0) {
		this->panel = panel;
	}

	void setFromTo(int from, int to) {
		this->from = from;
		this->to = to;
	}

	void paint(Graphics& g) {
		g.setColour(Colours::grey);
		//		g.fillRoundedRectangle(0, 0, getWidth(), getHeight(), 3);
		//		g.setColour(Colours::black);
		paintButton(g, true, true);
	}

	void mouseUp(const MouseEvent& e) {
		panel->switchPanels(from, to);
	}
};

#endif
